package com.msda.utils;

import java.lang.reflect.Field;

public class AllFieldsNotNull {
    public static boolean allFieldsNotNull(Object obj) throws IllegalAccessException {
        if (obj == null) {
            return false;
        }

        for (Field field : obj.getClass().getDeclaredFields()) {
            field.setAccessible(true);
            if (field.get(obj) == null) {
                return false;
            }
        }

        return true;
    }
}
